tests/inst: cargo fmt
authorColin Walters <walters@verbum.org>
Wed, 17 Mar 2021 18:45:07 +0000 (18:45 +0000)
committerColin Walters <walters@verbum.org>
Wed, 17 Mar 2021 18:45:17 +0000 (18:45 +0000)
tests/inst/src/destructive.rs
tests/inst/src/test.rs

index e44704cf4364e18396354cc58cce423071fb4fa2..59ab59b1d0bae49044414ab4e0d1bfb1e13838fa 100644 (file)
@@ -108,21 +108,22 @@ impl RebootMark {
         strategy: &InterruptStrategy,
     ) -> &mut BTreeMap<UpdateResult, u32> {
         match strategy {
-            InterruptStrategy::Polite(t) => self
-                .polite
-                .entry(t.clone())
-                .or_insert_with(BTreeMap::new),
-            InterruptStrategy::Force(t) => self
-                .force
-                .entry(t.clone())
-                .or_insert_with(BTreeMap::new),
+            InterruptStrategy::Polite(t) => {
+                self.polite.entry(t.clone()).or_insert_with(BTreeMap::new)
+            }
+            InterruptStrategy::Force(t) => {
+                self.force.entry(t.clone()).or_insert_with(BTreeMap::new)
+            }
         }
     }
 }
 
 impl InterruptStrategy {
     pub(crate) fn is_noop(&self) -> bool {
-        matches!(self, InterruptStrategy::Polite(PoliteInterruptStrategy::None))
+        matches!(
+            self,
+            InterruptStrategy::Polite(PoliteInterruptStrategy::None)
+        )
     }
 }
 
@@ -598,9 +599,7 @@ fn transactionality() -> Result<()> {
             upgrade_and_finalize().context("Firstrun upgrade failed")?;
             let end = time::Instant::now();
             let cycle_time = end.duration_since(start);
-            let tdata = TransactionalTestInfo {
-                cycle_time,
-            };
+            let tdata = TransactionalTestInfo { cycle_time };
             let mut f = std::io::BufWriter::new(std::fs::File::create(&TDATAPATH)?);
             serde_json::to_writer(&mut f, &tdata)?;
             f.flush()?;
index 1d9c29d5828b45ec5ee49b4772c22b6886e3fa5b..11d23ab75534d250e419d02884158936d56c21c5 100644 (file)
@@ -82,7 +82,7 @@ pub(crate) const TEST_HTTP_BASIC_AUTH: &str = "foouser:barpw";
 fn validate_authz(value: &[u8]) -> Result<bool> {
     let buf = std::str::from_utf8(&value)?;
     if let Some(o) = buf.find("Basic ") {
-    let (_, buf) = buf.split_at(o + "Basic ".len());
+        let (_, buf) = buf.split_at(o + "Basic ".len());
         let buf = base64::decode(buf).context("decoding")?;
         let buf = std::str::from_utf8(&buf)?;
         Ok(buf == TEST_HTTP_BASIC_AUTH)